package com.turing.post.datatranferpmbs.util;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 实体表 -- Pmbs.MchAddTradDetail
 *
 * @author 杨新斌
 *
 * @version 1.0.0
 * @since 2009-08-31
 */
@SuppressWarnings("serial")
@Entity
@Table(name="MchAddTradDetail")
@IdClass(PMBSMchAddTradDetail.class)
public class PMBSMchAddTradDetail implements Serializable {

	/**
	 * 商户号
	 */
	@Id
	@Column(name = "MerchantNo",nullable=false)
	private String MerchantNo;

	public String getMerchantNo() {
		return MerchantNo;
	}

	public void setMerchantNo(String merchantNo) {
		MerchantNo = merchantNo;
	}

	/**
	 * 帐务日期
	 */
	@Id
	@Column(name = "TranDate",nullable=false)
	private java.util.Date TranDate;

	public java.util.Date getTranDate() {
		return TranDate;
	}

	public void setTranDate(java.util.Date tranDate) {
		TranDate = tranDate;
	}
	
	/**
	 * 流水号
	 */
	@Id
	@Column(name = "TranSeqNo",nullable=false)
	private String TranSeqNo;

	public String getTranSeqNo() {
		return TranSeqNo;
	}

	public void setTranSeqNo(String tranSeqNo) {
		TranSeqNo = tranSeqNo;
	}
	
	/**
	 * 产品序号
	 */
	@Id
	@Column(name = "ProdSeqNo",nullable=false)
	private Integer ProdSeqNo;
	
	public Integer getProdSeqNo() {
		return ProdSeqNo;
	}

	public void setProdSeqNo(Integer prodSeqNo) {
		ProdSeqNo = prodSeqNo;
	}

	/**
	 * 商户产品 Id
	 */
	@Column(name = "MrchProdId",nullable=true)
	private String MrchProdId;

	public String getMrchProdId() {
		return MrchProdId;
	}

	public void setMrchProdId(String mrchProdId) {
		MrchProdId = mrchProdId;
	}
	
	/**
	 * 商户产品名称
	 */
	@Column(name = "MrchProdName",nullable=true)
	private String MrchProdName;

	public String getMrchProdName() {
		return MrchProdName;
	}

	public void setMrchProdName(String mrchProdName) {
		MrchProdName = mrchProdName;
	}
	
	/**
	 * 商户产品数量
	 */
	@Column(name = "MrchProdQuantity",nullable=true)
	private BigDecimal MrchProdQuantity;

	public BigDecimal getMrchProdQuantity() {
		return MrchProdQuantity;
	}

	public void setMrchProdQuantity(BigDecimal mrchProdQuantity) {
		MrchProdQuantity = mrchProdQuantity;
	}
	
	/**
	 * 商户产品单价
	 */
	@Column(name = "MrchProdPrice",nullable=true)
	private BigDecimal MrchProdPrice;

	public BigDecimal getMrchProdPrice() {
		return MrchProdPrice;
	}

	public void setMrchProdPrice(BigDecimal mrchProdPrice) {
		MrchProdPrice = mrchProdPrice;
	}

	/**
	 * 商户产品总价
	 */
	@Column(name = "MrchProdAmount",nullable=true)
	private BigDecimal MrchProdAmount;

	public BigDecimal getMrchProdAmount() {
		return MrchProdAmount;
	}

	public void setMrchProdAmount(BigDecimal mrchProdAmount) {
		MrchProdAmount = mrchProdAmount;
	}

	/**
	 * 折扣后价格
	 */
	@Column(name = "MrchProdCost",nullable=true)
	private BigDecimal MrchProdCost;

	public BigDecimal getMrchProdCost() {
		return MrchProdCost;
	}

	public void setMrchProdCost(BigDecimal mrchProdCost) {
		MrchProdCost = mrchProdCost;
	}

	/**
	 * 产品实际售价
	 */
	@Column(name = "MrchProdFactSale",nullable=true)
	private BigDecimal MrchProdFactSale;

	public BigDecimal getMrchProdFactSale() {
		return MrchProdFactSale;
	}

	public void setMrchProdFactSale(BigDecimal mrchProdFactSale) {
		MrchProdFactSale = mrchProdFactSale;
	}

	/**
	 * 邮局成本
	 */
	@Transient
	@Column(name = "MrchProdProfitSys",nullable=true)
	private BigDecimal MrchProdProfitSys;

	public BigDecimal getMrchProdProfitSys() {
		return MrchProdProfitSys;
	}

	public void setMrchProdProfitSys(BigDecimal mrchProdProfitSys) {
		MrchProdProfitSys = mrchProdProfitSys;
	}

	/**
	 * 商户方成本
	 */
	@Transient
	@Column(name = "MrchProdProfitMch",nullable=true)
	private BigDecimal MrchProdProfitMch;

	public BigDecimal getMrchProdProfitMch() {
		return MrchProdProfitMch;
	}

	public void setMrchProdProfitMch(BigDecimal mrchProdProfitMch) {
		MrchProdProfitMch = mrchProdProfitMch;
	}
	
	public boolean equals(Object obj) {
		if (obj == this)
			return true;

		if (!(obj instanceof PMBSMchAddTradDetail))
			return false;

		PMBSMchAddTradDetail pk = (PMBSMchAddTradDetail) obj;

		if (!MerchantNo.equals(pk.getMerchantNo()))
			return false;

		if (!TranDate.equals(pk.getTranDate()))
			return false;

		if (!TranSeqNo.equals(pk.getTranSeqNo()))
			return false;

		if (!ProdSeqNo.equals(pk.getProdSeqNo()))
			return false;
		
		return true;
	}

	public int hashCode() {
		return MerchantNo.hashCode() + TranDate.hashCode() + TranSeqNo.hashCode() + ProdSeqNo.hashCode();
	}
}
